package com.heima.utils.thread;

import com.heima.model.wemedia.pojos.WmUser;

/**
 * 自媒体微服务的线程工具类
 */
public class WmThreadLocalUtil {

    private final  static  ThreadLocal<WmUser> WM_USER_THREAD_LOCAL
            = new ThreadLocal<>();
    /**
     * 添加数据
     */
    public static  void setUser(WmUser wmUser){
        WM_USER_THREAD_LOCAL.set(wmUser);
    }
    /**
     * 获取数据
     */
    public static  WmUser getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }
    /**
     * 清理数据
     */
    public static  void clear(){
        WM_USER_THREAD_LOCAL.remove();
    }

}
